#! /usr/bin/env python
# -*- coding:utf-8 -*-
# author:无涯

import  requests
import  pytest

@pytest.fixture()
def login():
  r=requests.post(
    url='http://47.95.142.233:8000/login/auth/',
    json={"username":"13484545195","password":"asd888"})
  return r.json()['token']

def test_index(login):
  r=requests.get(
    url='http://47.95.142.233:8000/interface/index',
    headers={'Authorization':'JWT {token}'.format(token=login)})
  print(r.json())

if __name__ == '__main__':
  pytest.main(["-v","-s","test_dayn_params.py"])
